import axios from "axios"
import {dev_baseURL} from "./httpAddress"
axios.create({
    baseURL: dev_baseURL, // api的默认地址base_url
    timeout: 5000,// 请求超时时间ms
})

axios.defaults.baseURL = "/api";

axios.interceptors.request.use((config) => { //请求拦截
    return config;
},(error)=> {
    return Promise.reject(error);
});
axios.interceptors.response.use(function (response) { //响应拦截
    if (response.data.code === 401) {
        
    }
    return response;
}, (error) => {
    return Promise.reject(error);
});

export default axios
